/**
  ******************************************************************************
  * @file    demo_api.h
  * @author  Aizbot
  * @brief   xxx.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2023 AizBot.
  * All rights reserved.</center></h2>
  *
  * http://www.aizbot.com
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DEMO_API_H
#define __DEMO_API_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "common.h"
#include "zqfifo.h"
#include "zqlink.h"

/* Exported constants --------------------------------------------------------*/
#define DEMO_SIZE_PACKET			(ZQLINK_PACKET_LEN_SHORT)

#define DEMO_CMD_TEST				0x0F
#define DEMO_CMD_TEST_SUB1			0xF1
#define DEMO_CMD_TEST_SUB2			0xF2

/* Exported macro ------------------------------------------------------------*/
#ifdef DEMO_API_C
#define DEMO_API_EXT
#else
#define DEMO_API_EXT extern
#endif

/* Exported types ------------------------------------------------------------*/
/** 
  * @brief  xxx
  */
typedef enum 
{
	DEMO_API_UART,
	DEMO_API_BLE,
	DEMO_API_WIFI
}DEMO_API_t;

/* Exported variables --------------------------------------------------------*/
DEMO_API_EXT Zqlink_t 	demo_api_handle;
DEMO_API_EXT uint8_t 	demo_buf_payload[DEMO_SIZE_PACKET];
DEMO_API_EXT uint8_t 	demo_buf_feedback[DEMO_SIZE_PACKET];
DEMO_API_EXT uint8_t 	demo_buf_in[DEMO_SIZE_PACKET];
DEMO_API_EXT uint8_t 	demo_buf_out[DEMO_SIZE_PACKET];
DEMO_API_EXT Zqfifo_t 	demo_fifo_in;
DEMO_API_EXT Zqfifo_t 	demo_fifo_out;

/* Exported functions --------------------------------------------------------*/
DEMO_API_EXT void Demo_Api_Init(void);
DEMO_API_EXT void Demo_Api_Task(void);
DEMO_API_EXT void Demo_Api_SendData(Zqlink_Msg_t *msg, Zqfifo_t *fifo, Zqlink_t *handle);
DEMO_API_EXT void Demo_Api_RecSuccess(Zqlink_Msg_t *msg, uint8_t device);
DEMO_API_EXT void Demo_Api_RecError(Zqlink_Msg_t *msg, uint8_t device);

#ifdef __cplusplus
}
#endif

#endif /* __DEMO_API_H */

/************************ (C) COPYRIGHT Aizbot *****END OF FILE***************/
